﻿//-----------------------------------------------------------------------
// <copyright file="IClientUpdateService.cs" company="FastNET Services">
//     Copyright (c) 2008-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Usings

using System.ServiceModel;
using GateShift.Common.WcfDataContracts.Contracts;

#endregion

namespace GateShift.Common.WcfDataContracts.Services
{
    /// <summary>
    /// ServiceContract used for checking on client updates
    /// </summary>
    [ServiceContract]
    public interface IClientUpdateService
    {
        /// <summary>
        /// Gets a string Uri to the requested Torrent for a client update
        /// </summary>
        /// <param name="request">TorrentUriRequest containing information about the torrent request</param>
        /// <returns>TorrentUriResponse on where to get the torrent file</returns>
        [OperationContract]
        TorrentUriResponse GetTorrentUri(TorrentUriRequest request);

        /// <summary>
        /// Checks whether or not the specified file is up to date by comparing the hash code
        /// </summary>
        /// <param name="request">FileVersionCheckRequest containing information about the file request</param>
        /// <returns>FileVersionCheckResponse on the file's next action</returns>
        [OperationContract]
        bool CheckFileVersion(FileVersionCheckRequest request);
    }
}